package com.chinaunicom.structure.flyweight;

/**
 * @author liry
 * @version 1.0
 * @date Created on 2022/8/10 15:02
 * Description: 树的外部属性
 */
public class Tree {
    
    // 坐标
    private String x;
    private String y;
    
    // 树的共性部分
    private TreeType treeType;

    public Tree(String locationX, String locationY, TreeType treeType) {
        this.x = locationX;
        this.y = locationY;
        this.treeType = treeType;
    }

    public String getX() {
        return x;
    }

    public void setX(String x) {
        this.x = x;
    }

    public String getY() {
        return y;
    }

    public void setY(String y) {
        this.y = y;
    }

    public TreeType getTreeType() {
        return treeType;
    }

    public void setTreeType(TreeType treeType) {
        this.treeType = treeType;
    }

    public void draw() {
        System.out.println("location X: " + this.getX());
        System.out.println("location Y: " + this.getY());
    }
}
